function makesvg(percentage, inner_text, svgWidth, full) {
    var inner_text = "";
    var abs_percentage = Math.abs(percentage).toString();
    var full = full;
    var percentage_str = percentage.toString();
    var classes = "";
    var backgroundClass = 'circle-chart__background';

    if (percentage < 0) {
        classes = "danger-stroke circle-chart__circle--negative";
    } else if (percentage >= 100) {
        if (full) {
            classes = "success-stroke";
        } else {
            classes = "warning-stroke";
            backgroundClass = 'circle-chart__backgroundFull';
        }


    } else {
        classes = "success-stroke";
    }


    var shtml_chart__circle = '';
    if (percentage != 0) {
        shtml_chart__circle = '<circle class="circle-chart__circle ' + classes + '"' + 'stroke-dasharray="' + abs_percentage + ',100" cx="16.9" cy="16.9" r="14.9"></circle>';
    }

    var shtml_inner_text = '';
    // if(inner_text){
    //   shtml_inner_text = '<text class="circle-chart__subline" x="16.91549431" y="22">'+inner_text+'</text>'
    // }


    var svg =
        '<svg class="circle-chart" width="' + svgWidth + '" height="' + svgWidth + '" viewbox="0 0 33.83098862 33.83098862" xmlns="http://www.w3.org/2000/svg">' +
            '<circle class="' + backgroundClass + '" cx="16.9" cy="16.9" r="14.9"></circle>' +
            shtml_chart__circle +

            // '<g class="circle-chart__info">'+
                // + '   <text class="circle-chart__percent" x="17.9" y="15.5">'+percentage_str+'%</text>' +
                // shtml_inner_text +
            // '</g>' +
        '</svg>';

    return svg
}

(function ($) {

    $.fn.circlechart = function (svgWidth) {
        this.each(function () {
            var percentage = $(this).data("percentage");
            var full = $(this).data('full');
            full = full == 'true' || full == true ? true : false;
            var inner_text = $(this).text();
            $(this).append(makesvg(percentage, inner_text, svgWidth, full));
        });
        return this;
    };

}(jQuery));